package com.xckj.cycling.dialog

import android.content.Context
import android.os.Bundle
import android.view.ViewGroup
import com.xckj.cycling.R
import com.xckj.cycling.databinding.DialogStopNavigationBinding

class UpdateHasCarDialog(context: Context, private val callback: (Boolean) -> Unit) :
    BaseDialog(context) {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val vb = DialogStopNavigationBinding.inflate(
            layoutInflater,
            window?.decorView as ViewGroup?, false
        )
        vb.content.text = context.getString(R.string.do_you_have_an_emojo_trike)
        vb.buttons.confirm.text = context.getString(R.string.yes)
        vb.buttons.cancel.text = context.getString(R.string.no)
        setContentView(vb.root)
        vb.buttons.cancel.setOnClickListener {
            callback.invoke(false)
            dismiss()
        }
        vb.buttons.confirm.setOnClickListener {
            callback.invoke(true)
            dismiss()
        }
    }
}